<%--
  Created by IntelliJ IDEA.
  User: hasee
  Date: 2017/10/23
  Time: 17:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>管理页面</title>
</head>
<body>
<h1 align="center">商品列表</h1>
<div align="center"><a href="${pageContext.request.contextPath}/product/addproduct.jsp" >添加</a></div>
<form action="" align="center">
    <table border="1" align="center" width="50%">
        <tr>
            <td width="5%">序号</td>
            <td width="10%">商品名称</td>
            <td width="5%">价格</td>
            <td width="2%">操作</td>
        </tr>
        <c:forEach var="product" items="${productlist}" varStatus="status">
            <tr>
                <td>${status.count}</td>
                <td>${product.pname}</td>
                <td>${product.shopPrice}</td>
                <td>
                    <a href="${pageContext.request.contextPath}/product/updateproduct.jsp?pid=${product.pid}&pname=${product.pname}&marketPrice=${product.marketPrice}&shopPrice=${product.shopPrice}&pdesc=${product.pdesc}">修改</a>&nbsp
                    <a href="javascript:if(confirm('确定删除该商品?'))location='${pageContext.request.contextPath}/removeProductServlet?pid=${product.pid}'">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>
</form>
</body>
</html>
